class LoadingUI extends egret.DisplayObjectContainer {
    public loadingBg:egret.BitmapText;
    public xy_logo:egret.BitmapText;
    public loadingText:egret.BitmapText;
    private bloodBg:egret.BitmapText;
    public blood:egret.BitmapText;
    // public textfield:egret.TextField;
    // public textF:egret.TextField;

    public constructor() {
        super();
        RES.getResByUrl("loadingResource/assets/loadingUI.fnt" , this.createView , this,RES.ResourceItem.TYPE_FONT);
        RES.getResByUrl("loadingResource/assets/loadingUI.fnt" , this.createXY , this,RES.ResourceItem.TYPE_FONT);
        RES.getResByUrl("loadingResource/assets/loadingUI.fnt" , this.createloadingText , this,RES.ResourceItem.TYPE_FONT);
        RES.getResByUrl("loadingResource/assets/loadingUI.fnt" , this.setProgress , this,RES.ResourceItem.TYPE_FONT);
        RES.getResByUrl("loadingResource/assets/loadingUI.fnt" , this.setBlood , this,RES.ResourceItem.TYPE_FONT);
        
    }

    //背景
    public createView(font:egret.BitmapFont):void {    
        // this.loadingBg = new egret.Bitmap();
        // this.loadingBg.texture = RES.getRes("loading_bg_png");
        // this.addChild(this.loadingBg);
        // this.loadingBg.y = 0;
        // this.loadingBg.x = 0;
        // // this.loadingBg.width = 480;
        // // this.loadingBg.height = 400;


        this.loadingBg = new egret.BitmapText();
        this.loadingBg.font = font;
        this.loadingBg.scaleX = 1;
        this.loadingBg.scaleY = 1;
        this.loadingBg.x = 0;
        this.loadingBg.y = 0;
        this.addChild(this.loadingBg);
        this.loadingBg.text = "b";
    }

    // 小易logo
    public createXY(font:egret.BitmapFont):void {
        // console.log('logo1');
        // this.xy_logo = new egret.Bitmap();
        // this.xy_logo.texture = RES.getRes("loading-logo_png");
        // this.xy_logo.width = 200;
        // this.xy_logo.height = this.xy_logo.width * (494/357);
        // this.xy_logo.x = 140;
        // this.xy_logo.y = 300;
        // this.addChild(this.xy_logo);

        this.xy_logo = new egret.BitmapText();
        this.xy_logo.font = font;
        this.xy_logo.scaleX = 0.5;
        this.xy_logo.scaleY = 0.5;
        this.xy_logo.x = 220;
        this.xy_logo.y = 300;
        this.addChild(this.xy_logo);
        this.xy_logo.text = "l";
    }

    // loading文字
    public createloadingText(font:egret.BitmapFont):void {    
        this.loadingText = new egret.BitmapText();
        this.loadingText.font = font;
        this.loadingText.scaleX = 0.5;
        this.loadingText.scaleY = 0.5;
        this.loadingText.x = 110;
        this.loadingText.y = 10;
        this.addChild(this.loadingText);
        this.loadingText.text = "ting";
    }

    // 进度条背景
    public setProgress(font:egret.BitmapFont):void{
        this.bloodBg = new egret.BitmapText();
        this.bloodBg.font = font;
        this.bloodBg.scaleX = 0.5;
        this.bloodBg.scaleY = 0.5;
        this.bloodBg.x = 60;
        this.bloodBg.y = 680;
        this.addChild(this.bloodBg);
        this.bloodBg.text = "a";
    }

    // 进度条红条
    public setBlood(font:egret.BitmapFont):void{
        this.blood = new egret.BitmapText();
        this.blood.font = font;
        this.blood.scaleX = 0.5;  //满条是13.34
        this.blood.scaleY = 0.5;
        this.blood.x = 66.5;
        this.blood.y = 686;
        this.addChild(this.blood);
        this.blood.text = "x";
    }

}
